﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>基础框架平台服务前端预览中心-主从表服务</title>
    <link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="bootstrap/css/bootstrap-theme.min.css" rel="stylesheet" />
    <link href="bootstrap/css/bootstrap-table.css" rel="stylesheet" />
    <link href="bootstrap/css/bootstrap-table-fixed-columns.css" rel="stylesheet" />
    <link href="bootstrap/css/bootstrap-editable.css" rel="stylesheet" />
    <link href="bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet" />
    <link href="css/docs.css" rel="stylesheet" />
    <link href="css/pygments-manni.css" rel="stylesheet" />
</head>
<body style="background-color: #F1F3FA;">
    <nav class="navbar navbar-default" style="margin-top:5px; margin-bottom:5px;">
        <div class="container-fluid">
            <div class="navbar-header" style="font-size:16px; padding-top:8px;">
                <span style="font-size: 23px; border: solid 1px #DDDDDD; padding:0px 5px; margin-right:25px; float:left;">主从表查询服务</span>
                <span id="sp_seviceUrl" style="float:left; padding-top:6px; font-size:15px;"></span>
            </div>
        </div>
    </nav>
    <ul class="nav nav-tabs" role="tablist">
        <li role="presentation" class="active"><a href="#home" aria-controls="home" role="tab" data-toggle="tab">主从表预览</a></li>
        <li role="presentation"><a href="#serviceAPI" aria-controls="profile" role="tab" data-toggle="tab">主从表服务API</a></li>
    </ul>
    <div class="tab-content">
        <div role="tabpanel" class="tab-pane fade in active" id="home">
            <div class="panel panel-primary" style="margin-bottom:5px;">
                <div class="panel-heading">主从表预览</div>
                <div class="panel-body">
                    <div class="container-fluid row pre-scrollable" style="height:300px;">
                        <div id="toolbar" class="form-inline">
                            <div id="txtSearch" class="form-group">
                            </div>
                            <button id="btn_search" type="button" class="btn btn-success">查询</button>
                        </div>
                        <table id="masterTable"></table>
                    </div>
                </div>
            </div>
            <div class="panel panel-primary" style="margin-bottom:5px;">
                <div class="panel-heading">从表预览</div>
                <div class="panel-body">
                    <div class="tabbable-custom nav-justified">
                        <ul id="ultab" class="nav nav-tabs nav-justified">
                        </ul>
                        <div id="tabcount" class="tab-content" style="border-left: solid 1px #ddd; border-right: solid 1px #ddd; border-bottom: solid 1px #ddd; padding: 5px; ">

                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div role="tabpanel" class="tab-pane fade" id="serviceAPI">
            <div class="panel panel-primary">
                <div class="panel-heading">主从表服务API</div>
                <div class="panel-body">
                    <h4>分页查询主表数据服务</h4>
                    <div class="bs-callout bs-callout-warning">
                        <h4>服务地址</h4>
                        <p id="queryMasterTableList">
                        	<a href=""  target="_blank"><span class="p_url"></span></a>
                        </p>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>参数说明</h4>
                        <table class="table table-bordered table-striped js-options-table">
                            <thead><tr><th>名称</th><th>类型</th><th>说明</th></tr></thead>
                            <tbody>
                                <tr>
                                    <td>serviceID</td>
                                    <td>String</td>
                                    <td>服务ID</td>
                                </tr>
                                <tr>
                                    <td>pageNO</td>
                                    <td>int</td>
                                    <td>当前页数,从1开始(默认值1)</td>
                                </tr>
                                <tr>
                                    <td>pageSize</td>
                                    <td>int</td>
                                    <td>页大小(默认值10)</td>
                                </tr>
                                <tr>
                                    <td>conQuery</td>
                                    <td>Json</td>
                                    <td>
                                        查询条件,格式为{"key":"value","key":"value","key":"value","key":"value"....}
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>调用说明</h4>
                        <p>
                            使用ajax调用，支持get请求,返回Json数据格式{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":[{数据集合}]}},
                            可以使用bootstrap-table直接调用不用做处理，如是使用其他js类库，请注意返回的Json格式
                        </p>
                        <figure class="highlight">
                            <pre><code class="language-js" data-lang="js">
<span class="c1">//bootstrap调用实例-分页显示</span>
<span class="nx">$(</span><span class="s">"#tb_dataList"</span><span class="nx">).bootstrapTable({  </span>
    <span class="nx">url : </span><span class="s">'<span class="s_url"></span>/business/extMasterServer/queryMasterTableList'</span><span class="nx">,</span>
    <span class="nx">pagination : true,</span>
    undefinedText:<span class="s"> '-'</span>,
    queryParams : queryParams,  <span class="c1">// 参数  </span>
    pagination: true,  <span class="c1">// 分页  </span>
    striped: true,  <span class="c1">// 是否显示行间隔色 </span>
    cache: false,  <span class="c1">// 是否使用缓存 </span>
    pageList: [5, 10, 20],
    toolbar: <span class="s">""</span>,  <span class="c1">// 指定工具栏 </span>
    showColumns: true,
    showRefresh: true,
    sidePagination: <span>"server"</span>,
    responseHandler: function (res) {
        return {
            "total": res.data.total,<span class="c1">//总页数</span>
            "rows": res.data.rows <span class="c1">//数据</span>
        };
    },                                
    columns : [
    <span id="s_col"></span>
    ]
});
<span class="c1">//参数方法</span>
function queryParams(pageReqeust) {  
     var temp = {
            serviceID: <span class="s">'<span class="s_id"></span>'</span>,
            pageNO: pageReqeust.offset / pageReqeust.limit + 1,<span class="c1">//当前页</span>
            pageSize: pageReqeust.limit,<span class="c1">//页大小</span>
            conQuery: <span class="s">''</span>
      };
    return temp;
}
<span class="c1">//ajax调用实例</span>
$.ajax({
    type : <span class="s">'get'</span>,<span class="c1">//请求方式GET</span>
    url : <span class="s">'<span class="s_url"></span>/business/extMasterServer/queryMasterTableList'</span> ,
    async : false,
    data :{serviceID:<span class="s">'<span class="s_id"></span>'</span>,pageNO:<span class="s">'1'</span>,pageSize:<span class="s">'10'</span>,conQuery:<span class="s">''</span>},
    success : function(data) {
    <span class="c1">//返回data结果，Json格式的数据{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":[{数据集合}]}}</span>
    }
});
                 
                        </code></pre>
                        </figure>
                    </div>
                    <h4>查询从表数据服务</h4>
                    <div class="bs-callout bs-callout-warning">
                        <h4>服务地址</h4>
                        <p id="querySlaveTBbyMasterID">
                        	<a href=""  target="_blank"><span class="p_url"></span></a>
                        </p>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>参数说明</h4>
                        <table class="table table-bordered table-striped js-options-table">
                            <thead><tr><th>名称</th><th>类型</th><th>说明</th></tr></thead>
                            <tbody>
                                <tr>
                                    <td>serviceID</td>
                                    <td>String</td>
                                    <td>服务ID</td>
                                </tr>
                                <tr>
                                    <td>guid</td>
                                    <td>String</td>
                                    <td>主表主键的值</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>调用说明</h4>
                        <p>
                            使用ajax调用，支持get请求,返回Json数据格式:{"从表名称":"[Json数据集合]...}
                        </p>
                        <figure class="highlight">
                            <pre><code class="language-js" data-lang="js">
<span class="c1">//ajax调用实例</span>
$.ajax({
    type : <span class="s">'get'</span>,<span class="c1">//请求方式GET</span>
    url : <span class="s">'<span class="s_url"></span>/business/extMasterServer/querySlaveTBbyMasterID'</span> ,
    async : false,
    data :{serviceID:<span class="s">'<span class="s_id"></span>'</span>,guid:<span class="s">'主表主键的值'</span>},
    success : function(data) {
            <span class="c1">//返回data结果，Json格式的数据:{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":{"从表名称":"[Json数据集合]...}}</span>
    }
});
                 
                        </code></pre>
                        </figure>
                    </div>
                    <h4>查询主表显示字段信息服务</h4>
                    <div class="bs-callout bs-callout-warning">
                        <h4>服务地址</h4>
                        <p id="queryTableShowField">
                        	<a href=""  target="_blank"><span class="p_url"></span></a>
                        </p>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>参数说明</h4>
                        <table class="table table-bordered table-striped js-options-table">
                            <thead><tr><th>名称</th><th>类型</th><th>说明</th></tr></thead>
                            <tbody>
                                <tr>
                                    <td>serviceID</td>
                                    <td>String</td>
                                    <td>服务ID</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>调用说明</h4>
                        <p>
                            使用ajax调用，支持get请求,返回Json数据格式:fieldname(字段英文名称)，fieldnamecn(字段中文名称)、
                            fieldtype(字段数据类型)
                        </p>
                        <figure class="highlight">
                            <pre><code class="language-js" data-lang="js">
<span class="c1">//ajax调用实例</span>
$.ajax({
    type : <span class="s">'get'</span>,<span class="c1">//请求方式GET</span>
    url : <span class="s">'<span class="s_url"></span>/business/extMasterServer/queryTableShowField'</span> ,
    async : false,
    data :{serviceID:<span class="s">'<span class="s_id"></span>'</span>},
    success : function(data) {
               <span class="c1">//返回data结果，Json格式的数据{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":[{"fieldname":"字段英文名称","fieldnamecn":"字段中文名称","fieldtype":"字段数据类型"}....]}</span>
    }
});
                 
                        </code></pre>
                        </figure>
                    </div>
                    <h4>主表查询字段信息服务</h4>
                    <div class="bs-callout bs-callout-warning">
                        <h4>服务地址</h4>
                        <p id="TableQueryField">
                        	<a href=""  target="_blank"><span class="p_url"></span></a>
                        </p>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>参数说明</h4>
                        <table class="table table-bordered table-striped js-options-table">
                            <thead><tr><th>名称</th><th>类型</th><th>说明</th></tr></thead>
                            <tbody>
                                <tr>
                                    <td>serviceID</td>
                                    <td>String</td>
                                    <td>服务ID</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>调用说明</h4>
                        <p>
                            使用ajax调用，支持get请求,返回Json数据格式:fieldname(字段英文名称)，fieldnamecn(字段中文名称)、
                            fieldtype(字段数据类型)
                        </p>
                        <figure class="highlight">
                            <pre><code class="language-js" data-lang="js">
<span class="c1">//ajax调用实例</span>
$.ajax({
    type : <span class="s">'get'</span>,<span class="c1">//请求方式GET</span>
    url : <span class="s">'<span class="s_url"></span>/business/extMasterServer/queryTableQueryField'</span> ,
    async : false,
    data :{serviceID:<span class="s">'<span class="s_id"></span>'</span>},
    success : function(data) {
         <span class="c1">//返回data结果，Json格式的数据{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":[{"fieldname":"字段英文名称","fieldnamecn":"字段中文名称","fieldtype":"字段数据类型"}....]}</span>
    }
});
                 
                        </code></pre>
                        </figure>
                    </div>
                    <h4>从表显示字段信息服务</h4>
                    <div class="bs-callout bs-callout-warning">
                        <h4>服务地址</h4>
                        <p id="DetailShowField">
                        	<a href=""  target="_blank"><span class="p_url"></span></a>
                        </p>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>参数说明</h4>
                        <table class="table table-bordered table-striped js-options-table">
                            <thead><tr><th>名称</th><th>类型</th><th>说明</th></tr></thead>
                            <tbody>
                                <tr>
                                    <td>serviceID</td>
                                    <td>String</td>
                                    <td>服务ID</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>调用说明</h4>
                        <p>
                            使用ajax调用，支持get请求,返回Json数据格式:{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":{"从表名称":"[{\"fieldname\":\"字段英文名称\",\"fieldnamecn\":\"字段中文名称\",\"fieldtype\":\"字段数据类型\"}...]]}
                        </p>
                        <figure class="highlight">
                            <pre><code class="language-js" data-lang="js">
<span class="c1">//ajax调用实例</span>
$.ajax({
    type : <span class="s">'get'</span>,<span class="c1">//请求方式GET</span>
    url : <span class="s">'<span class="s_url"></span>/business/extMasterServer/queryTableDetailShowField'</span> ,
    async : false,
    data :{serviceID:<span class="s">'<span class="s_id"></span>'</span>},
    success : function(data) {
           <span class="c1">//返回data结果，Json格式的数据{"result":"查询结果状态码(0成功,1失败)","message":"查询结果信息","data":{"total":"总条数","rows":{"从表名称":"[{\"fieldname\":\"字段英文名称\",\"fieldnamecn\":\"字段中文名称\",\"fieldtype\":\"字段数据类型\"}...]]}</span>
    }
});
                 
                        </code></pre>
                        </figure>
                    </div>
                    <h4>查询主表主键字段服务</h4>
                    <div class="bs-callout bs-callout-warning">
                        <h4>服务地址</h4>
                        <p id="tablePrimaryKey">
                        	<a href=""  target="_blank"><span class="p_url"></span></a>
                        </p>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>参数说明</h4>
                        <table class="table table-bordered table-striped js-options-table">
                            <thead><tr><th>名称</th><th>类型</th><th>说明</th></tr></thead>
                            <tbody>
                                <tr>
                                    <td>serviceID</td>
                                    <td>String</td>
                                    <td>服务ID</td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="bs-callout bs-callout-info">
                        <h4>调用说明</h4>
                        <p>
                            使用ajax调用，支持get请求,返回主表主键字段英文名称
                        </p>
                        <figure class="highlight">
                            <pre><code class="language-js" data-lang="js">
<span class="c1">//ajax调用实例</span>
$.ajax({
    type : <span class="s">'get'</span>,<span class="c1">//请求方式GET,POST</span>
    url : <span class="s">'<span class="s_url"></span>/business/extMasterServer/queryMasterTablePrimaryKey'</span> ,
    async : false,
    data :{serviceID:<span class="s">'<span class="s_id"></span>'</span>},
    success : function(data) {
          <span class="c1">//返回data结果，返回主表主键字段英文名称</span>
    }
});
                 
                        </code></pre>
                        </figure>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <script src="js/jquery-1.10.2.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootstrap/js/bootstrap-table.min.js"></script>
    <script src="bootstrap/js/bootstrap-table-zh-CN.js"></script>
    <script src="bootstrap/js/bootbox.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="js/services/serviceConfig.js"></script>
    <script src="js/services/masterDetailServices.js"></script>
    <script src="js/docs.js"></script>
</body>
</html>
